<template>
  <div>
  <el-divider style="margin: 0rem;" content-position="left"><h3 style="font-size: 1.15rem;">班级管理</h3></el-divider>
  <my-table listPath="tbClass/page" savePath="tbClass/save" deletePath="tbClass/delete" :table="table" :pageParams="pageParams" :rules="rules" dialogTitle="对话框" :pageSize="[5,10,20,35,50]" :dialogForm="form">
    <template v-slot:dialogSlot>
      <el-form-item label="班级名称" prop="name">
          <el-input v-model="form.name" clearable></el-input>
      </el-form-item>
      <el-form-item label="班主任" prop="manager">
          <el-input v-model="form.manager" clearable></el-input>
      </el-form-item>
    </template>
  </my-table>
  </div>
</template>

<script>
  import myTable from '../../components/myTable.vue';
  export default{
    name:'course',
    components:{myTable},
    data() {
      return {
       pageParams:{
            limit:10,
            page:1,
            sort:'id',
            order:'asc',
            search:''
        }
        ,
        form:{
          name:'',
          manager:''
        },
        table:[
          {
            title:'序号',
            field:'id'
          },
          {
            title:'班级名称',
            field:'name'
          },
          {
            title:'班主任',
            field:'manager'
          }
        ],
        rules:{
          manager: [{ required: true, message: '请输入班主任', trigger: 'change' }],
          name: [{required: true, message: '请输入班级名称', trigger: 'change' }],
        },
      }
    },
    methods:{
    },
		created() {
			var role =window.sessionStorage.getItem("role")
				if(role!=='ROLE_ADMIN'){
					this.$router.back();
			}
		}
  }
</script>

<style>
</style>
